package com.slunk.pavornocturnus.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.slunk.pavornocturnus.PavorNocturnusGameObject;
import com.slunk.pavornocturnus.PavorNocturnusHotSpots;
import com.slunk.pavornocturnus.PavorNocturnusScreenObject;
import com.slunk.platforms.SRenderSprite;

public class PavorNocturnusBottomPanelScreen extends PavorNocturnusScreenObject{
	public PavorNocturnusBottomPanelScreen(PavorNocturnusGameObject game) {
		super(game);
		// TODO Auto-generated constructor stub
		Texture texture = new Texture(Gdx.files.internal("data/libgdx.png"));
		texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		
		TextureRegion region = new TextureRegion(texture, 0, 0, 512, 275);
		
		SRenderSprite sprite = new SRenderSprite(region);
		sprite.isTouchEnabled = true;
		sprite.alias = "Libgdx";
		spriteCollection.addChild(sprite);
		this.newHandler.RegisterTargetedObject(sprite);
		
		this.setUpHotspots();
	}
	
	public void setUpHotspots() {
		//top
		PavorNocturnusHotSpots topArrow = new PavorNocturnusHotSpots(textureAtlas.createSprite("arrow"), PavorNocturnusFrontPanelScreen.class.getName());
		topArrow.getSprite().setPosition(Gdx.graphics.getWidth()/2 - topArrow.getSprite().getWidth()/2, Gdx.graphics.getHeight() - topArrow.getSprite().getHeight());
		topArrow.getSprite().setRotation(-90.0f);
		spriteCollection.addChild(topArrow);
		this.newHandler.RegisterTargetedObject(topArrow);
	}

	@Override
	public void show() {
	}
	
	@Override
	public void targetedObjectTouchDown(Object sender, float screenX, float screenY) {
		// TODO Auto-generated method stub
		if (sender instanceof PavorNocturnusHotSpots) {
			onHotSpotTouched((PavorNocturnusHotSpots)sender);
		}
	}

	@Override
	public void targetedObjectTouchUp(Object sender, float screenX, float screenY) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void targetedObjectTouchDragged(Object sender, float screenX, float screenY) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void targetedObjectMouseMoved(Object sender, float screenX, float screenY) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean keyDown(int keycode) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean keyUp(int keycode) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean keyTyped(char character) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchDown(int screenX, int screenY, int pointer, int button) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchUp(int screenX, int screenY, int pointer, int button) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchDragged(int screenX, int screenY, int pointer) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean mouseMoved(int screenX, int screenY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean scrolled(int amount) {
		// TODO Auto-generated method stub
		return false;
	}
}
